package com.isoft.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.isoft.dao.CounterDynamicsDao;
import com.isoft.entity.CounterDynamics;
import com.isoft.entity.PageBean;
import com.isoft.entity.UrgeBoarding;
import com.isoft.service.ICounterDynamicsService;
import com.isoft.util.ReturnCountertData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CounterDynamicsService implements ICounterDynamicsService {
    @Autowired
    CounterDynamicsDao dynamicsDao;
    @Override
    public PageBean selectCounterDynamics(Integer page , Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        List<CounterDynamics> counterDynamicsList = dynamicsDao.selectCounterDynamics();
        Page<CounterDynamics> p = (Page<CounterDynamics>) counterDynamicsList;
        PageBean pageBean = new PageBean((int) p.getTotal(), p.getResult());
        return pageBean;
    }
}
